package com.addplus.townmall.server.api.mapper.town;

import com.addplus.townmall.server.api.model.town.DiscountCardMemberRecord;
import com.addplus.townmall.server.api.model.town.expand.DiscountCardMemberRecordExpand;
import com.addplus.townmall.server.api.utils.BaseAddMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 商城会员卡购买记录详细表 Mapper 接口
 * </p>
 *
 * @author zhangjiehang
 * @since 2018-08-27
 */
public interface DiscountCardMemberRecordMapper extends BaseAddMapper<DiscountCardMemberRecord> {
    @Select("SELECT id,member_id,discount_card_id,discount_card_name,order_id,duration,offer_amount,buy_price,start_date as start,end_date as end,is_deleted,gmt_create,gmt_modified FROM discount_card_member_record WHERE is_deleted = 0 ORDER BY gmt_modified DESC")
    List<DiscountCardMemberRecordExpand> getAllDiscountCardMemberRecord(IPage page);
}
